local iori_run = class('iori_run',function()
	return display.newNode()
end)

function iori_run:ctor()
	--self:pos(0,200)
	local frames = display.newFrames("iori2_%03d.png", 18, 8)

	--if not self.iori then print('... not have run iori ...') end
	self.iori = self.iori or {}
	self.body = self.body or {}
	local tmp
	local n = 1
	local dx = display.width/4
	local dy = display.height/2
	for r=1,2 do
		for c=1,4 do
			tmp = cc.Sprite:createWithSpriteFrame(frames[n])
			tmp:pos(dx/2+dx*(c-1),dy/2+dy*(r-1))
			display.newSolidCircle(8,{color = cc.c4f(0.0,0,1.0,0.8)}):addTo(tmp)
			self.iori[#self.iori+1] = tmp:addTo(self)
			n = n + 1
			--if n == 8 then break end
		end
	end

	local spriteWidth = self.iori[1]:getContentSize().width
	local spriteHeight = self.iori[1]:getContentSize().height

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(84,122) ,cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-84)/2 - 100,(spriteHeight-122)/2 -8))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(86,116),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-86)/2 - 92,(spriteHeight-116)/2 - 10))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(80,82),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-80)/2 - 96,(spriteHeight-82)/2 - 42))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(80,112),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-80)/2 - 100,(spriteHeight-112)/2 - 16))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(80,118),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-80)/2 - 104,(spriteHeight-118)/2 - 8))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(86,118),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-86)/2 - 96,(spriteHeight-118)/2 - 10))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(82,82),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-82)/2 - 96,(spriteHeight-82)/2 - 45))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(78,114),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-78)/2 - 104,(spriteHeight-114)/2 - 16))

	for i=1,8 do
		self.iori[i]:setPhysicsBody(self.body[i])
		self.body[i]:setContactTestBitmask(3)
		self.body[i]:setTag(130+i)
	end

end

return iori_run